package com.lanou3g.code0418.control;

/**
 * Created by dllo on 18/4/18.
 */
public class Test01 {
    public static void main(String[] args) {

        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println("A");

                    //yield表明线程的一种态度 线程放弃CPU使用的权利,但CPU可决定分配使用
                    Thread.yield();
                }
            }
        }).start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println("B");
                    Thread.yield();
                }
            }
        }).start();
    }
}
